- content_for :head do
  = stylesheet_link_tag 'graders'
  <meta http-equiv ="refresh" content="60"/>

%h1 Grader information

= link_to '[Refresh]', :action => 'list'
%br/

.submitbox
  .item
    Grader control:
  .item
    - form_for :clear, nil, :url => {:action => 'start_grading'} do |f|
      = submit_tag 'Start graders in grading env'
  .item
    - form_for :clear, nil, :url => {:action => 'start_exam'} do |f|
      = submit_tag 'Start graders in exam env'
  .item
    - form_for :clear, nil, :url => {:action => 'stop_all'} do |f|
      = submit_tag 'Stop all running graders'
  .item
    - form_for :clear, nil, :url => {:action => 'clear_all'} do |f|
      = submit_tag 'Clear all data'
  %br{:style => 'clear:both'}/

- if @last_task
  Last task:
  = link_to "#{@last_task.id}", :action => 'view', :id => @last_task.id, :type => 'Task'

  %br/

- if @last_test_request
  Last test_request:
  = link_to "#{@last_test_request.id}", :action => 'view', :id => @last_test_request.id, :type => 'TestRequest'


%h2 Current graders

= render :partial => 'grader_list', :locals => {:grader_list => @grader_processes}

%h2 Stalled graders

= render :partial => 'grader_list', :locals => {:grader_list => @stalled_processes}

%h2 Terminated graders

- form_for :clear, nil, :url => {:action => 'clear_terminated'} do |f|
  = submit_tag 'Clear data for terminated graders'

= render :partial => 'grader_list', :locals => {:grader_list => @terminated_processes}
